var db;
function createDatabase() {
    db = window.sqlitePlugin.openDatabase({name: 'magongshou.db', location: 'default'});
    db.transaction(function(tx) {
        tx.executeSql('CREATE TABLE IF NOT EXISTS TONGE_CONFIG_SYS(ID INTEGER PRIMARY KEY AUTOINCREMENT, CONF_KEY VARCHAR(64), CONF_VALUE VARCHAR(512))');
    }, function(error){
        console.log("checkDb失败"+error);
        document.getElementById("createInfo").innerHTML = "创建数据库失败："+error;
    }, function(){
        console.log("数据库文件创建成功");
        document.getElementById("createInfo").innerHTML = "数据库文件创建成功";
    });
}

function  closeDatabase() {
    db.close(function(){
        document.getElementById("closeInfo").innerHTML = "关闭数据库成功";
    },function(error){
        document.getElementById("closeInfo").innerHTML = "关闭数据库失败："+error;
    })
}